<?php
use Buan\UrlCommand;
$currentSiteId = ($site = SiteManager::getCurrentSite())!==NULL ? $site->id : NULL;
?>

<div class="head">
	<h1>Sites</h1>
</div>

<table class="list">
	<caption>Sites</caption>
	<thead>
		<tr>
			<th>Prefix</th>
			<th>Options</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach($sites as $s): ?>
		<tr>
			<td><?php $this->html->e($s->prefix); ?></td>
			<td>
				<a href="<?php $this->html->eUrl(UrlCommand::createUrl('scribble', 'site', $s->id)); ?>">Edit</a>
				<?php if($currentSiteId!=$s->id): ?>
					| <a href="http://<?php $this->html->e("{$s->prefix}".UrlCommand::createUrl('scribble')); ?>" title="Administer this site">Administer</a>
				<?php endif; ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</tbody>
</table>